<!-- 附件上传 -->
<template>
	 <el-upload
            class="upload-demo"
            action="/member-security/file/fileUploadCommon"
			:on-success="handleAvatarSuccess"
			:before-upload = "handleupload"
            :on-preview="handlePreview"
            :on-remove="handleRemove"
            :before-remove="beforeRemove"
             multiple
            :limit="3"
			:headers="headers"
            :on-exceed="handleExceed"
            :file-list="fileList">
            <el-button v-blur size="small" type="primary">点击上传</el-button>
            <div slot="tip" class="el-upload__tip">请上传格式为.jpg的照片</div>
    </el-upload>
</template>

<script>
   
	export default {
		name: "fileUpload",
		props: {
			
		},
		components: {},
		data() {
			return {
				headers: {
				  token: window.sessionStorage.getItem('token')
			   },
			   fileList: [],
			};
		},
		created() {},
		methods: {
			handleRemove(file, fileList) {
				console.log(file, fileList);
			},
			handlePreview(file) {
				console.log(file);
			},
			handleExceed(files, fileList) {
				this.$message.warning(`当前限制选择 3 个文件，本次选择了 ${files.length} 个文件，共选择了 ${files.length + fileList.length} 个文件`);
			},
			beforeRemove(file, fileList) {
				return this.$confirm(`确定移除 ${ file.name }？`);
			},
			handleAvatarSuccess(file){
               console.log(file)
			},
			handleupload(file){
                console.log(file) 
			},

		}
	};
</script>

<style scoped="" lang="scss">

</style>
